package com.chengshi.shop.dao.system;

import com.chengshi.shop.model.system.ShopConfig;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ShopConfigMapper {
    int deleteByPrimaryKey(Integer configId);

    int insert(ShopConfig record);

    int insertSelective(ShopConfig record);

    ShopConfig selectByPrimaryKey(Integer configId);

    int updateByPrimaryKeySelective(ShopConfig record);

    int updateByPrimaryKey(ShopConfig record);

    /**
     * 获取系统配置
     * @param key
     * @return
     */
    String getConfig(String key);

    /**
     * 保存商家配置
     * @param key
     * @param value
     */
    void saveConfig(@Param("key") String key, @Param("value") String value);

    /**
     * key查询对应的配置
     * @param key
     * @return
     */
    ShopConfig findByKey(String key);

    /**
     * 获取商城配置列表
     * @return
     */
    List<ShopConfig> getList();
}